package com.liruo.treasureattic.config.common.util;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.http.HttpSession;

/**
 * @Author:liruo
 * @Date:2023-02-18-20:21:10
 * @Desc
 */
@Slf4j
public class SessionHolder{
    private final static ThreadLocal<HttpSession> holder = new ThreadLocal<>();
    public static void set(HttpSession session){
        holder.set(session);
    }
    public static HttpSession get(){
        return holder.get();
    }

    public static void clear() {
        holder.set(null);
    }
}
